﻿using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet.UI
{
    static class WeakEventHelper
    {
        internal static void AddWeakPropertyChanged(INotifyPropertyChanged owner, PropertyChangedEventHandler value)
        {
            Contract.Requires(value != null);
            OpenLS.Chart.UI.WeakEventHelper.AddWeakPropertyChanged(owner, value);
//            INotifyPropertyChanged nic = owner;
  //          PropertyChangedEventHandler weakEvent = EventHandlerHelper.MakeWeakPropertyChanged(value, v => nic.PropertyChanged -= v);
    //        nic.PropertyChanged += weakEvent;
        }

        public static void AddWeakCollectionChanged(INotifyCollectionChanged owner, NotifyCollectionChangedEventHandler value)
        {
            Contract.Requires(value != null);
            OpenLS.Chart.UI.WeakEventHelper.AddWeakCollectionChanged(owner, value);
        }
    }
}
